Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scoping bug for errors on collector service Run #194

Merged
merged 2 commits into from
Dec 21, 2021

Conversation

phenixrizen
Copy link
Contributor

I had a tab error in my config yaml and the extension layer collector was hanging with no error output which led me to this bug.

The current logic will never receive the error returned from appErr := c.svc.Run(ctx) because error will be out of scope and the collector will hang. This creates a channel and assures we check the error. This allows us to get the config error.

@linux-foundation-easycla
Copy link

CLA Not Signed

err = appErr
}
}()
err := c.svc.Run(context.Background())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why is context.Background() better than ctx here?

Copy link
Contributor Author

@phenixrizen phenixrizen Dec 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch that should be the passed context. I was working off a older version that had no context passed to Run.

Copy link
Contributor

@NathanielRN NathanielRN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this change! It looks useful 🙂

@phenixrizen
Copy link
Contributor Author

Any update on getting this merged would like to use this instead of a fork.

@NathanielRN
Copy link
Contributor

It's hard with people on holidays I guess, but I also would like to see this merged because I have ran into it too 😞

@codeboten think you could merge this when you have a chance? 🙂

Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants